package org.apache.ibatis.lynchTest;

import org.apache.ibatis.reflection.TypeParameterResolver;

import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.sql.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author lynch
 * @since 2024/11/19 v1.0
 */
public class Main {
    public static void main(String[] args) throws NoSuchMethodException {
      /*  Type type1 = TypeParameterResolver.resolveReturnType(User.class.getMethod("getInfo"), User.class);
        System.out.println("User类中getInfo方法的输出结果类型:\n"+type1);
*/
        List<String> a = new ArrayList<>();
        Method getInfo = Student.class.getMethod("getInfo");
        System.out.println(getInfo.getReturnType());
        System.out.println(getInfo.getGenericReturnType());

        Type type2 = TypeParameterResolver.resolveReturnType(getInfo, Student.class);
        System.out.println("Student类中getInfo方法的输出结果类型:\n"+type2);
    }
}
